package test.App.Demo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

// lombok技术可以实现为类自动添加getter setter 方法 无参构造器
@Data // @Data会为类添加getter setter 无参构造器
@NoArgsConstructor
@AllArgsConstructor // @AllArgsConstructor 会为类添加全参构造器

public class Card {

    private String name;
    private String CarId;
    private String phone;
    private double money;

    // 预存金额
    public void saveMoney(double money) {
        this.money += money;
    }

    // 消费金额
    public void payMoney(double money) {
        this.money -= money;
    }
}
